<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->
<head>
    <title>编辑轮播</title>
</head>
<body>
<div layout:fragment="content">
    <div class="content-frame">
        <div class="content-frame-right" >
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">编辑轮播</h3>
                            <ul class="panel-controls">
                                <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <h4>上传封面:</h4>
                            <div class="block push-up-10">
                                <form id="bannerImageForm" class="dropzone dropzone-mini dz-clickable"><div class="dz-default dz-message"><span>上传截图</span></div></form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-frame-body content-frame-body-left">

            <div class="row">
                <div class="col-md-12">

                    <form class="form-horizontal" id="bannerForm">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">新增轮播</h3>
                                <ul class="panel-controls">
                                    <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                                </ul>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">标题</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="hidden"  name="id" th:value="${entity.id}"/>
                                            <input type="text" class="form-control" name="title" th:value="${entity.title}"/>
                                            <input type="hidden" class="form-control" id="bannerImage" name="image" th:value="${entity.image}"/>
                                        </div>
                                        <span class="help-block">这里填写标题</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">选择影片</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" readonly="true" id="movieName" th:value="${entity.movieName}" />
                                            <input type="hidden" class="form-control" name="movieId" id="movieId" th:value="${entity.movieId}"  />
                                            <span class="input-group-btn">
                                                    <a class="btn btn-default" data-toggle="modal" data-target="#modal_basic_banner_movie">选择影片</a>
                                            </span>
                                        </div>
                                        <span class="help-block">这里选择影片</span>
                                    </div>
                                </div>


                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">顺序</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-sort-numeric-asc"></span></span>
                                            <input type="number" class="form-control" required="true" min="0" max="10" th:value="${entity.sort}"/>
                                        </div>
                                        <span class="help-block">这里填写显示顺序</span>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <button class="btn btn-default">重填</button>
                                <a class="btn btn-primary pull-right" id="submit-banner-form-btn">提交</a>
                            </div>
                        </div>
                    </form>

                </div>
            </div>

        </div>

    </div>

    <div class="modal " id="modal_basic_banner_movie" tabindex="-1" role="dialog" aria-labelledby="defModalHead" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="defModalHead">Basic Modal</h4>
                </div>
                <div class="modal-body">
                    <table class="table datatable_simple" id="banner-movies-table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>片名</th>
                            <th>淸晰度</th>
                            <th>区域</th>
                            <th>类型</th>
                            <th>价格</th>
                            <th>已售</th>
                            <th>上架时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="movie : ${movies}">
                            <td><input type="checkbox"  th:value="${movie.id}" th:data="${movie.movie_name}"/></td>
                            <td th:text="${movie.movie_name}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_CLARITY' and dic.keyValue==movie.clarity}" th:text="${dic.caption}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_AREA' and dic.keyValue==movie.area}" th:text="${dic.caption}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TYPE' and dic.keyValue==movie.type}" th:text="${dic.caption}"></td>
                            <td th:text="${movie.price}"></td>
                            <td th:text="${movie.total}">0</td>
                            <td th:text="${#dates.format(movie.create_time,'yyyy-MM-dd HH:mm:ss')}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-success" data-dismiss="modal" id="banner-add-movie-btn">确定</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>